using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
using Microsoft.EntityFrameworkCore;
using ShopForWeb.Model.Basic;
using ShopForWeb.Model.DBContexts;

namespace ShopForWeb.Services
{
    public class AdminService
    {
        private ShopDBContext _db;
        public AdminService(ShopDBContext db)
        {
            _db=db;
        }
        public List<Admin> GetAll()
        {
            throw new NotImplementedException();
        }
        public Admin? GetById(long adminId)
        {
            throw new NotImplementedException();
        }
          public int Modify(Admin admin)
        {
            throw new NotImplementedException();
        }
           public int AddNew(Admin admin)
        {
            throw new NotImplementedException();
        }
        public int ModifyStatus(long adminId,int statusCode)
        {
            throw new NotImplementedException();
        }
        public async Task<Admin?>GetByLoginAsync(string phone,string password)
        {
            var query=_db.AdminSet
             .Where(a=>a.Phone==phone&&a.Password==password);
             return await query.FirstOrDefaultAsync();
        }
    }
}